package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.BusinessMapper;
import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class BusinessServiceImpl implements BusinessService {
   @Autowired
    private BusinessMapper businessMapper;
    @Override
    public List<Business> getOrderByTypeId(Integer orderTypeId)  {
        List<Business> businesses=new ArrayList<>();
        try {
            businesses=businessMapper.getOrderByTypeId(orderTypeId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return businesses;
    }

    @Override
    public Business getBusinessById(Integer businessId) {
        Business business=new Business();
        try {
            business=businessMapper.getBusinessById(businessId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return business;
    }
}
